
<%@page import="controller.Utils"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="models.Domain"%>
<%@page import="com.googlecode.objectify.Query"%>
<%
Domain list = (Domain) request.getAttribute("list");
String domain = (String) request.getAttribute("domain");
int pages = Integer.parseInt((String) request.getAttribute("page"));
NumberFormat nf = NumberFormat.getInstance();
String url = "out-link/"+domain;

String title = "Page - "+pages+" | Out link "+domain;
String description="Outbound link "+domain+" Page - "+pages+".The domain has the inbound link "+domain+" on moodify";
String keyword = domain+","+"link,out-link,check link";
%>

<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
	<jsp:param name="description" value="<%=description %>" />
	<jsp:param name="keywords" value="<%=keyword %>" />
</jsp:include>

<div id="content">

	<div class='search'>
		<form action="/search-link" method="get">
			<input class="input" type="text" name="name"
				onclick="javascript:if(this.value=='Enter your domain...')this.value=''"
				value="Enter your domain...">
			<button type="submit">Check link</button>
		</form>
		<div class="clear"></div>
		<div class="adv728 clear_div">
			<jsp:include page="/adv/728x90.jsp"></jsp:include>
		</div>
	</div>

	<div>
		<jsp:include page="/adv/728x15.jsp"></jsp:include>
		<%
          	int count = 0;
          	if(list!=null&&list.getOutLink().size()>0)
			{
				count = list.getOutLink().size();
			}
          	%>	
        <h1><a href="/site/<%=domain %>"><%=domain %></a></h1>  	
		<p>These are out-links list of <i><%=domain %></i> ( <strong><%=count %></strong> )</p>
		<table class="exp">
		<%
		int k=0;
		if(count>0)
		{
		%>
  		 	<%
  		 	int start = (pages-1)*30;
			int end = (pages-1)*30 + 30;
			
			if(end > list.getOutLink().size())
			{
				end = list.getOutLink().size();
			}
			%>
			<tr>
   		 		<th align="left">Domain</th>
   		 		<th></th>
   		 	</tr>
			<%
			for(int i=start;i < end;i++)
			{
 				k++;
  		 	%>
  		 		<tr>
       		 		<td><% if(!Utils.fomatDomain(list.getOutLink().get(i)).trim().equals("")){ %><a href="/site/<%=Utils.fomatDomain(list.getOutLink().get(i)) %>"><%=Utils.fomatDomain(list.getOutLink().get(i)) %></a><% } %></td>
       		 		<td class="right"><% if(!Utils.fomatDomain(list.getOutLink().get(i)).trim().equals("")){ %>Check link <a href="/check-link/<%=Utils.fomatDomain(list.getOutLink().get(i)) %>"><%=Utils.fomatDomain(list.getOutLink().get(i)) %></a><% } %></td>
       		 	</tr>
  		 	<%
  		 	}
		} else {
  		 	%>
  		 	<tr><td>
	 			Currently, we don't find in-links from your site. You can use tools is listed below to find more and more information about your site.
	 			<br/><br/>
	 			<a href="/network">Network tool</a> | <a href="/pagerank">Check pagerank</a> | <a href="/ip-lookup">Lookup ip</a>
	 		</td></tr>
  		<%
  		}
  		%> 	
  		 </table>
  		 <div class="clear"></div>
	 	 <ul class="paginate">
			<li >
				<jsp:include page="paginates.jsp">
					<jsp:param name="cur_page" value="<%=pages %>"/>
					<jsp:param name="url" value="<%=url %>"/>
					<jsp:param name="number_game" value="<%=k %>"/>
				</jsp:include>
			</li>
		</ul> 
	</div>
</div>

<jsp:include page="layout/footer.jsp"></jsp:include>
